#!/bin/bash
set -e

if [ -z "$TAKIN_TRO_WEB_INNER" ]; then
     TAKIN_TRO_WEB_INNER=127.0.0.1 
fi
if [ -z "$TAKIN_TRO_CLOUD_INNER" ]; then
     TAKIN_TRO_CLOUD_INNER=127.0.0.1 
fi

sed -i -e "s/http:\/\/127.0.0.1:10008\/takin-web/http:\/\/$TAKIN_TRO_WEB_INNER:10008\/takin-web/g" /etc/nginx/nginx.conf
sed -i -e "s/http:\/\/127.0.0.1:10010\/takin-cloud/http:\/\/$TAKIN_TRO_CLOUD_INNER:10010\/takin-cloud/g" /etc/nginx/nginx.conf

nginx
